package muilty_thread.atomic;

import java.util.concurrent.atomic.AtomicLongFieldUpdater;

public class LongFieldTest {


    public static void main(String[] args) {
        Class<Person> clazz = Person.class;

        AtomicLongFieldUpdater<Person> fieldUpdater = AtomicLongFieldUpdater.newUpdater(clazz, "id");
        Person person = new Person(213214L);
        System.out.println(fieldUpdater.compareAndSet(person, 213214L, 2132133));
        System.out.println(fieldUpdater.get(person));


    }
}

